﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Areas/Admin/Views/Shared/MainContent.Master" Inherits="System.Web.Mvc.ViewPage" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
商品分类
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="cphMeta" runat="server">

 <script type="text/javascript" src="/js/treeTable/javascripts/jquery.treeTable.js"></script>
    <link href="/js/treeTable/stylesheets/jquery.treeTable.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
        $(document).ready(function () {
            $("#ETList").treeTable({
                childPrefix: "child-of-",
                clickableNodeNames: false, expandable: false, indent: 19, initialState: "collapsed", treeColumn: 0
            });
        });
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<%=Html.Partial("ETTree", ViewData["itemcats"])%>
<div id="rightBox">

 <div class="tabListBox">
  <table id="ETList" cellpadding="0" cellspacing="0">
       <thead>
        <tr align="center">
            <th>分类名称</th>
            <th>所属归类</th>
            
        </tr>
		</thead>
        <tbody>
       
        <% foreach (var item in ViewData["itemcats"] as IEnumerable<MShop.Core.Domain.ItemCat>)
           { %>
        <tr <%if(!item.IsRoot)Response.Write("class='"+item.TableRowClass+"'"); %> id='<%=item.TableRowId %>'>
            <td>
                <%: item.Name %> 
            </td>
            <td>
                <%: item.ParentId.HasValue?item.ItemCat2.Name:"" %>
            </td>           	
        </tr>
        <%  } %>
        </tbody>
    </table>
</div>
</div>

 <script type="text/javascript">
     $(document).ready(function () {
         var box = null;
         if (document.getElementById('rightBox')) {
             box = $("#rightBox");
         }
         else {
             box = $("#fullBox");
         }
         var windowWidth = box.width();
         var windowHeight = box.height();         
             $('.tabListBox').css({ 'width': windowWidth + 'px', 'height': windowHeight + 'px' });
             $(window).resize(function () {
                 var windowWidth = $("#rightBox").width();
                 var windowHeight = $("#rightBox").height();
                 $('.tabListBox').css({ 'width': windowWidth + 'px', 'height': windowHeight + 'px' });
             });
             $('.tabListBox').fixedHeaderTable({ footer: false, cloneHeaderToFooter: false, autoResize: true, fixCol1: true });

             $('.tabListBox').find("tbody").find("tr").each(function (i) {
                 if (i % 2 == 1) {
                     $(this).find("td").addClass("tr1");
                 }
             });
             $('.tabListBox').find("tbody").find("tr").mouseover(function (i) {
                 $(this).find("td").addClass("tr0");
             });
             $('.tabListBox').find("tbody").find("tr").mouseout(function (i) {
                 $(this).find("td").removeClass("tr0");
             });
        
     });
</script>
</asp:Content>